<template>
	<view>

		<view class="body-view">
			<u-button :ripple="true" ripple-bg-color="#F0F0F0" :custom-style="quitLoginBtnCss" class="quit-login-btn"
			 type="primary">
				<view>{{userInfo.nickname}}</view>
			 </u-button>
		</view>

		<view class="body-bottom" style="position: fixed;width: 100%;bottom: 190rpx;text-align: center;">
			<u-button @click="quitLogin()" type="primary" size="mini">退出登录</u-button>
		</view>

		<b-tabbar icon-size="55rpx" :list="list" inactive-color="rgba(255,255,255,.7)" active-color="rgba(255,255,255,1)"
		 style="font-size: 50rpx;" />
	</view>
</template>

<script>
	import Request from '../../utils/Request.js'
	import bTabbar from '../../js/bTabbar.js';
	import Util from '../../utils/Util.js';
	
	let that;
	let list = bTabbar.getTabbarList();
	export default {
		data() {
			return {
				list: list,
				quitLoginBtnCss: {
					height: "400rpx",
					width: "400rpx",
					fontSize: "50rpx",
					fontWeight: "bold",
					borderRadius: "55%",
				},
				userInfo: {},
				deptInfo:{}
			}
		},
		mounted() {
			that = this;
			this.getUserInfo();
		},
		onShow() {
			this.getUserInfo();			
		},
		methods: {			
			getUserInfo() {
				Util.request({
					url: Request.path+"ces-user/get_user_info",
					success(res) {
						that.userInfo = res.data.data;
					}
				});
			},
			quitLogin(){
				Util.request({
					url: Request.path+"ces-user/quit_login",
					success(res) {
						uni.reLaunch({
							url: '/pages/login/login'
						})
					}
				});
			}
		}
	}
</script>

<style lang="scss">
	.body-view {
		border-radius: 55%;
		box-shadow: 0 0 35rpx rgba(0, 0, 0, .3);
		position: fixed;
		width: 400rpx;
		top: 50%;
		left: 50%;
		transform: translate(-50%, -50%);
	}

	.body-view:active {
		box-shadow: 0 0 20rpx gray;
	}
</style>
